package com.woniu.register.controller;

import com.woniu.common.util.Result;
import com.woniu.register.entity.Check;
import com.woniu.register.service.CheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: house-after
 * @description:
 * @author: qqq
 * @create: 2022-12-13 11:25
 **/
@RestController
@RequestMapping("Checks")
public class CheckController {
    @Autowired
    private CheckService checkService;

    @PostMapping("add")
    public Result add(@RequestBody Check check) {
        int i = checkService.insertSelective(check);
        if (i > 0) {
            return Result.ok();
        } else {
            return Result.error();
        }
    }
    @PostMapping("/padd")
    public int checkAdd(@RequestBody Check check){
        int i = checkService.pinsertSelective(check);
        return i;
    }
}